<template>
  <el-form :inline="true" :model="formInline" class="demo-form-inline">
    <el-form-item label="手机号/账号名搜索" class="form-item margin">
      <el-input v-model="formInline.mobile_or_account_name" placeholder="输入手机号/账号名搜索" class="form-label"></el-input>
    </el-form-item>
    <el-form-item class="buttons margin">
      <el-button class="search" type="search" @click="onSubmit('formInline')">查询</el-button>
    </el-form-item>
  </el-form>
</template>
<script setup lang="ts">
import { getCurrentInstance } from 'vue'
defineProps(['formInline'])
const internalInstance = getCurrentInstance()
const emit = defineEmits({
  searchChange: null
})
const onSubmit = (formName: string) => {
  const { mobile_or_account_name } = internalInstance?.proxy?.[formName]
  emit('searchChange', {
    mobile_or_account_name
  })
}
</script>
<style lang="scss" scoped>
.demo-form-inline {
  display: flex;
  justify-content: space-between;
  background-color: #f9f9f9;
  padding: 16px;
  .search {
    background-color: #ff6b00;
    color: #ffffff;
  }
}
.margin {
  margin-bottom: 0px;
}
</style>
